﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Bombardiman
{
    public class AnimatedGameObject: GameObject
    {
        private Animation animation;

        public AnimatedGameObject() 
            :base()
        {}
        
        public void Initialize(Texture2D texture, Vector2 position, bool active, int width, int height, Animation animation)
        {
            base.setTexture(texture);
            base.setPosition(position);
            base.setActive(active);
            base.setWidth(width);
            base.setHeight(height);

            this.animation = animation;
            animation.Initialize(texture, position, width, height);
        }

        public void Update(GameTime gameTime)
        {
            // needs edit
            animation.Update(gameTime);
            animation.setPosition(base.getPosition());
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            animation.Draw(spriteBatch);
        }

        public Animation getAnimation()
        {
            return animation;
        }
    }
}
